﻿using TestingConcurrencyBenchmark.Benchmarks.BenchmarkTests;
using TestingConcurrencyBenchmark.ProblemFactories;
using TestingConcurrencyBenchmark.Problems.ProducerConsumer;

namespace TestingConcurrencyBenchmark.Benchmarks
{
    public class ProducerConsumerBenchmark : AbstractBenchmark<AbstractProducerConsumer>
    {
        private readonly int _nbThreads;

        public ProducerConsumerBenchmark(int nbThreads) : base(new ProducerConsumerFactory())
        {
            _nbThreads = nbThreads;
        }

        protected override BenchmarkTest<AbstractProducerConsumer> CreateBenchmarkTest(AbstractProducerConsumer solution)
        {
            return new ProducerConsumerTest(solution, _nbThreads);
        }
    }
}